import type {AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig} from 'axios'

export interface RequestInterceptors {
	// 请求拦截
	requestInterceptors?: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig
	requestInterceptorsCatch?: (err: any) => any
	
	// 响应拦截
	responseInterceptors?: <T = AxiosResponse>(res: T) => T
	responseInterceptorsCatch?: (err: any) => any
}

export interface RequestConfig extends AxiosRequestConfig {
	interceptors?: RequestInterceptors
	showLoading?: boolean
	msgField?: string
}
